<!DOCTYPE html>
<html class="no-js" lang="">
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>No JS Checkbox Counter Demo</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style type="text/css">
  /* CSS styles */
  /* Example by Yuriy at https://codepen.io/anon/pen/eZWXOZ */

  body{
    background-image: linear-gradient(to right, #e7d1a5, #343e3e);
  }
  .container{
    margin: auto;
    width: 30%;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    background-color: #d8b671;
  }
  .box2{
    margin: 10px 0;
  }
  input:checked {
    counter-increment: list;
  }
  .result {
    display: none;
  }
  input:checked ~ .result {
    display: block;
  }
  .result::after {
    content: "Selected: "counter(list);
  }
 
  </style>

</head>
<body>
  <!--[if lt IE 8]>
  <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  <![endif]-->
  <div class="container">
    <div class="box1">
      <h3>Select any checkbox</h3>
    </div>
    <div class="box2">
      <input type="checkbox">
      <input type="checkbox">
      <input type="checkbox">
      <input type="checkbox">
      <input type="checkbox">
      <div class="result"></div>
    </div>
  </div>
    
</body>
</html>
